 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
 package com.viettel.core.dao.cms; 
import java.util.ArrayList; 
import java.util.List; 

import org.hibernate.type.StandardBasicTypes; 
import org.hibernate.type.Type; 
import org.springframework.beans.factory.annotation.Autowired; 

import com.viettel.core.exceptions.DataAccessException; 
import com.viettel.core.entities.cms.MailTemp;
import com.viettel.core.repo.IRepository;
 /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 10:50:59
   */
 public class MailTempDAOImpl implements MailTempDAO { 
	 private IRepository repo; 
		
	 	public void setRepo(IRepository repo) {
			this.repo = repo;
		}
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public MailTemp getMailTempById(Integer id) throws DataAccessException { 
		return repo.getEntityById(MailTemp.class, id); 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public MailTemp createMailTemp(MailTemp mailtemp) 
			throws DataAccessException { 
		if (mailtemp == null) { 
			throw new IllegalArgumentException("mailtemp"); 
		} 
		repo.create(mailtemp); 
		return repo.getEntityById(MailTemp.class, mailtemp.getId()); 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void updateMailTemp(MailTemp mailtemp) throws DataAccessException { 
		if (mailtemp == null) { 
			throw new IllegalArgumentException("mailtemp"); 
		} 
		repo.update(mailtemp); 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 10:50:59
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void deleteMailTemp(MailTemp mailtemp) throws DataAccessException { 
		if (mailtemp == null) { 
			throw new IllegalArgumentException("mailtemp"); 
		} 
		repo.delete(mailtemp); 
	} 
} 
 
